package com.bbx.taxi.client.Util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import android.content.Context;
import android.content.res.AssetManager;

/** 
 * @Path com.bbx.taxi.client.Util.AppJsonFileReader.java
 * @Author 严旭文
 * @Date 2016-1-16 下午1:49:12
 * @Company 蓝海（福建）信息技术有限公司
 * @Description
 * 读取assets文件的json文件
 */
public class AppJsonFileReader {  
    public static String getJson(Context context, String fileName) {  
  
        StringBuilder stringBuilder = new StringBuilder();  
        try {  
            AssetManager assetManager = context.getAssets();  
            BufferedReader bf = new BufferedReader(new InputStreamReader(  
                    assetManager.open(fileName)));  
            String line;  
            while ((line = bf.readLine()) != null) {  
                stringBuilder.append(line);  
            }  
        } catch (IOException e) {  
            e.printStackTrace();  
        }  
        return stringBuilder.toString();  
    } 
}